check process starling-<%= starling_port %> with pidfile <%= starling_run_dir %>/starling.pid
group starling
start program = "start-stop-daemon -c <%= starling_user %>:<%= starling_group %> --start --quiet --pidfile <%= starling_run_dir %>/starling.pid --exec /usr/local/bin/starling -- <%= starling_runtime_options %>"
stop program = "start-stop-daemon -c <%= starling_user %>:<%= starling_group %> --stop --quiet --pidfile <%= starling_run_dir %>/starling.pid --exec /usr/local/bin/starling -- <%= starling_runtime_options %>"
	
if failed host 127.0.0.1 port <%= starling_port %>
  	with timeout 10 seconds
  	then alert

if totalmem > 100 Mb then restart
if cpu > 60% for 2 cycles then alert
if cpu > 80% for 5 cycles then restart
if loadavg(5min) > 10 for 8 cycles then restart
if 3 restarts within 5 cycles then timeout